#include "form_back.h"
#include "ui_form_back.h"

Form_back::Form_back(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Form_back)
{
    ui->setupUi(this);
    ui->pushButton->setStyleSheet("QPushButton{border-image:url(:/Main/Images/Main/close.png);}QPushButton:hover{border-image:url(:/Main/Images/Main/closeon.png);}QPushButton:pressed{border-image:url(:/Main/Images/Main/close.png);}");        //设置关闭按钮样式表
    ui->label->setStyleSheet("border-image:url(:/Shop/Images/Shop/background_back.png)");
    ui->label_1->setStyleSheet("border-image:url(:/Data/Images/Data/jirou.png)");
    ui->label_2->setStyleSheet("border-image:url(:/Data/Images/Data/jitui.png)");
    ui->label_3->setStyleSheet("border-image:url(:/Data/Images/Data/liwu.png)");
    ui->label_4->setStyleSheet("border-image:url(:/Data/Images/Data/mianbao.png)");
    ui->label_5->setStyleSheet("border-image:url(:/Data/Images/Data/niunai.png)");
    ui->label_6->setStyleSheet("border-image:url(:/Data/Images/Data/shaizi.png)");
    ui->label_7->setStyleSheet("border-image:url(:/Data/Images/Data/xuegao.png)");
    ui->label_8->setStyleSheet("border-image:url(:/Data/Images/Data/yu.png)");
    ui->pushButton_1->setStyleSheet("QPushButton{border-image:url(:/Shop/Images/Shop/button_back.png);}QPushButton:hover{border-image:url(:/Shop/Images/Shop/button_back_h.png);}QPushButton:pressed{border-image:url(:/Shop/Images/Shop/button_back_p.png);}");
    ui->pushButton_2->setStyleSheet("QPushButton{border-image:url(:/Shop/Images/Shop/button_back.png);}QPushButton:hover{border-image:url(:/Shop/Images/Shop/button_back_h.png);}QPushButton:pressed{border-image:url(:/Shop/Images/Shop/button_back_p.png);}");
    ui->pushButton_3->setStyleSheet("QPushButton{border-image:url(:/Shop/Images/Shop/button_back.png);}QPushButton:hover{border-image:url(:/Shop/Images/Shop/button_back_h.png);}QPushButton:pressed{border-image:url(:/Shop/Images/Shop/button_back_p.png);}");
    ui->pushButton_4->setStyleSheet("QPushButton{border-image:url(:/Shop/Images/Shop/button_back.png);}QPushButton:hover{border-image:url(:/Shop/Images/Shop/button_back_h.png);}QPushButton:pressed{border-image:url(:/Shop/Images/Shop/button_back_p.png);}");
    ui->pushButton_5->setStyleSheet("QPushButton{border-image:url(:/Shop/Images/Shop/button_back.png);}QPushButton:hover{border-image:url(:/Shop/Images/Shop/button_back_h.png);}QPushButton:pressed{border-image:url(:/Shop/Images/Shop/button_back_p.png);}");
    ui->pushButton_6->setStyleSheet("QPushButton{border-image:url(:/Shop/Images/Shop/button_back.png);}QPushButton:hover{border-image:url(:/Shop/Images/Shop/button_back_h.png);}QPushButton:pressed{border-image:url(:/Shop/Images/Shop/button_back_p.png);}");
    ui->pushButton_7->setStyleSheet("QPushButton{border-image:url(:/Shop/Images/Shop/button_back.png);}QPushButton:hover{border-image:url(:/Shop/Images/Shop/button_back_h.png);}QPushButton:pressed{border-image:url(:/Shop/Images/Shop/button_back_p.png);}");
    ui->pushButton_8->setStyleSheet("QPushButton{border-image:url(:/Shop/Images/Shop/button_back.png);}QPushButton:hover{border-image:url(:/Shop/Images/Shop/button_back_h.png);}QPushButton:pressed{border-image:url(:/Shop/Images/Shop/button_back_p.png);}");

    ui->label_9->setStyleSheet("color:red");
    ui->label_9->setFont(QFont( "Timers" , 12 ,  QFont::Bold) );

    ui->label_10->setStyleSheet("color:red");
    ui->label_10->setFont(QFont( "Timers" , 12 ,  QFont::Bold) );

    ui->label_11->setStyleSheet("color:red");
    ui->label_11->setFont(QFont( "Timers" , 12 ,  QFont::Bold) );

    ui->label_12->setStyleSheet("color:red");
    ui->label_12->setFont(QFont( "Timers" , 12 ,  QFont::Bold) );

    ui->label_13->setStyleSheet("color:red");
    ui->label_13->setFont(QFont( "Timers" , 12 ,  QFont::Bold) );

    ui->label_14->setStyleSheet("color:red");
    ui->label_14->setFont(QFont( "Timers" , 12 ,  QFont::Bold) );

    ui->label_15->setStyleSheet("color:red");
    ui->label_15->setFont(QFont( "Timers" , 12 ,  QFont::Bold) );

    ui->label_16->setStyleSheet("color:red");
    ui->label_16->setFont(QFont( "Timers" , 12 ,  QFont::Bold) );




}

Form_back::~Form_back()
{
    delete ui;
}

void Form_back::change_number(int temp, int number)
{
    switch (temp) {
    case 1:
        ui->label_9->setText(QString::number(number,10));
        break;
    case 2:
        ui->label_10->setText(QString::number(number,10));
        break;
    case 3:
        ui->label_11->setText(QString::number(number,10));
        break;
    case 4:
        ui->label_12->setText(QString::number(number,10));
        break;
    case 5:
        ui->label_13->setText(QString::number(number,10));
        break;
    case 6:
        ui->label_14->setText(QString::number(number,10));
        break;
    case 7:
        ui->label_15->setText(QString::number(number,10));
        break;
    case 8:
        ui->label_16->setText(QString::number(number,10));
        break;
    default:
        break;
    }
}

void Form_back::on_pushButton_clicked()
{
    emit pushButton_on_clicked(9);
    this->close();              //调用系统关闭函数
}
void Form_back::on_pushButton_1_clicked()
{
    emit pushButton_on_clicked(1);
}

void Form_back::on_pushButton_2_clicked()
{
    emit pushButton_on_clicked(2);
}

void Form_back::on_pushButton_3_clicked()
{
    emit pushButton_on_clicked(3);
}

void Form_back::on_pushButton_4_clicked()
{
    emit pushButton_on_clicked(4);
}

void Form_back::on_pushButton_5_clicked()
{
    emit pushButton_on_clicked(5);
}

void Form_back::on_pushButton_6_clicked()
{
    emit pushButton_on_clicked(6);
}

void Form_back::on_pushButton_7_clicked()
{
    emit pushButton_on_clicked(7);
}

void Form_back::on_pushButton_8_clicked()
{
    emit pushButton_on_clicked(8);
}
